/* -*- C++ -*- */

//=============================================================================
/*
* @author Feloweria <380374483@qq.com>
* Copyright (C) Feloweria
*
* $ID 2014-05-14 11:24:02 AM
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
* @version 1.0
*/
//=============================================================================
#ifndef FLOWRIA_ACCEPT_INCLUDE
#define FLOWRIA_ACCEPT_INCLUDE

#include "Network/Socket.h"
#include "Thread/Thread.h"
FELOWRIA_BEGIN

class DLL_EXPORT Acceptor : public Thread
{	
public:
	Acceptor(const char *addr, int32 port);
	~Acceptor();
	
public:
	virtual void OnAccept(Socket *socket) = 0;

protected:
	virtual Socket* Alloc() = 0;

protected:
	bool Excute();

private:
	int64 listen_sock;
};

FELOWRIA_END

#endif // FLOWRIA_ACCEPT_INCLUDE
